<?php
        header("Content-type:text/html;charset=utf-8");
        $con = mysqli_connect("localhost", 'root', '', 'ksdb2');
        mysqli_set_charset($con, "utf8");
        
        $cs_id = $_GET['cs_id'];
        
        $cs_name = $_GET['cs_name'];
        
        $cs_credit = $_GET['cs_credit'];
        
        $cs_period = $_GET['cs_period'];
        

        $sql = "INSERT INTO course (cs_id, cs_name, cs_credit, cs_period) VALUES ('$cs_id','$cs_name','$cs_credit','$cs_period');";
        
        
        // 执行插入语句
        if($con->query($sql))
        {
            echo "添加成功";
        //删完回去表页面
        }
        else{
            echo "添加失败";
        }
        
        // 回到首页
        header("location:course.php");
        mysqli_close($con);
    ?>